<template>
  <div class="nav-bar">
    <el-menu
      mode="horizontal"
      :ellipsis="false"
      class="nav-menu"
      :router="true"
    >
      <el-menu-item index="/">
        <span class="title">智能学习系统</span>
      </el-menu-item>
      
      <div class="flex-grow" />
      
      <el-menu-item index="/search">
        <el-input
          v-model="searchQuery"
          placeholder="搜索知识点..."
          prefix-icon="Search"
          class="search-input"
        />
      </el-menu-item>
      
      <el-menu-item index="/learner-profile">
        <el-icon><UserFilled /></el-icon>
        学习画像
      </el-menu-item>
      
      <el-menu-item index="/progress">
        <el-icon><Trophy /></el-icon>
        我的进度
      </el-menu-item>
      
      <el-menu-item index="/learning-path">
        <el-icon><Share /></el-icon>
        学习路径
      </el-menu-item>
      
      <el-menu-item index="/error-book">
        <el-icon><Warning /></el-icon>
        错题本
      </el-menu-item>
      
      <el-menu-item index="/profile">
        <el-avatar :size="32" :src="userAvatar" />
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const searchQuery = ref('')
const userAvatar = ref('https://placeholder.com/32x32')
</script>

<style scoped>
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-menu {
  padding: 0 20px;
  height: 60px;
}

.logo {
  height: 32px;
  margin-right: 8px;
}

.title {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
}

.flex-grow {
  flex-grow: 1;
}

.search-input {
  width: 300px;
}
</style>